Skip to content

Conversation

@owlstronaut
Copy link
Contributor

@owlstronaut owlstronaut commented Nov 20, 2025

fixes #8757

This pull request improves the robustness of the OverrideSet class by ensuring that the doOverrideSetsConflict method can safely handle cases where one or both arguments are undefined or null. It also adds corresponding test coverage to verify this behavior.

It is apparently common for there not to be a second override set, so it is causing errors in 11.1.3

@owlstronaut owlstronaut marked this pull request as ready for review November 20, 2025 18:04
@owlstronaut owlstronaut requested a review from a team as a code owner November 20, 2025 18:04

static doOverrideSetsConflict (first, second) {
// If either override set is missing, there's no conflict
if (!first || !second) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're only gonna be able to get coverage here with a unit test because half of this is already being done upstream

else if (this.overrides && this.#to.edgesOut.size && OverrideSet.doOverrideSetsConflict(this.overrides, this.#to.overrides)) 

So, we should add && this.#to.overrides to the calling code intead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR remove the this.overrides from the calling code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wraithgar done - i added the this.#to.overrides to the callsite. I kept the original guard as well because I think it is still practical and safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [email protected] fails to install with overrides having npm error Cannot read properties of undefined (reading 'ruleset')

2 participants